package com.yxch.admin.controller.semester;

import com.yxch.admin.model.semester.SemesterDTO;
import com.yxch.admin.service.semester.SemesterService;
import com.yxch.admin.utils.ResultAPI;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/yxch/admin/semester")
public class SemesterController {
    @Autowired
    SemesterService semesterService;

    @GetMapping
    ResultAPI getAllSemesters(SemesterDTO semesterDTO) {
        return semesterService.getAllSemesters(semesterDTO);
    }

    @DeleteMapping("{ids}")
    ResultAPI deleteSemesters(@PathVariable("ids") List<Integer> ids) {
        return semesterService.deleteSemesters(ids);
    }
}
